from django.core.paginator import Paginator
from publish.models import Vistor
from django.shortcuts import render


def results_page(request):
    vistor = Vistor.objects.order_by('-id', 'money_involved')
    paginator = Paginator(vistor, 1)
    cur_page = request.GET.get('page', 1)
    page = paginator.page(cur_page)
    return render(request, 'ranking/daye.html', locals())


def lawyer_ranking(request):
    vistor = Vistor.objects.order_by('-id', 'money_involved')
    paginator = Paginator(vistor, 10)
    cur_page = request.GET.get('page', 1)
    page = paginator.page(cur_page)
    return render(request, 'ranking/lawyer.html', locals())
